//package com.kiki.stater.security.jwt;
//
//import com.kiki.stater.security.Admins;
//import com.kiki.stater.security.Authority;
//import org.springframework.security.core.GrantedAuthority;
//import org.springframework.security.core.authority.SimpleGrantedAuthority;
//
//import java.util.List;
//import java.util.stream.Collectors;
//
///**
// * Created by mazeyi on 2021/1/21.
// */
//public class JwtUserFactory {
//
//    private JwtUserFactory() {
//    }
//
//    public static JwtUser create(Admins user){
//        return new JwtUser(
//                user.getAid(),
//                user.getState(),
//                user.getAname(),
//                user.getPwd(),
//                "123@qq.com",
//                mapToGrandAuthroties(user.getAuthorities()),
//                user.getAexist()==1?true:false,
//                user.getLastPasswordResetDate()
//        );
//    }
//
//    private static List<GrantedAuthority> mapToGrandAuthroties(List<Authority> authorities) {
//        return authorities.stream()
//                .map(authority -> new SimpleGrantedAuthority(authority.getName().name()))
//                .collect(Collectors.toList());
//
//
//    }
//}